package com.shen;

import java.io.File;
import java.io.FileOutputStream;
import java.util.Scanner;

/**
 * Author:shen
 * CreateDate:2020/6/1.
 * Function:
 */
public class demo04 {
    static Scanner scanner=new Scanner(System.in);
    public static void main(String[] args) {

        System.out.println("请输入一个文件名：");
        String name=scanner.nextLine();
        File file=new File("e:/a/"+name);
        if(file.exists()){
            file.delete();
            System.out.println("该文件删除成功！");
        }else{
            System.out.println("该文件不存在！");
        }

    }

}
